package net.neuronal.tasador;

import java.math.BigDecimal;
import java.util.Map;

public class Normalizar {

	private static Map<String,String> calles = Util.readFile("calle.txt", 49);
	
	public static void main(String[] args) {
		
		if("-n".equals(args[0])){
			System.out.println(input(args[1]));
		}
		else if("-d".equals(args[0])){
			System.out.println(output(args[1]));
		}
		else{
			System.out.println("Parametros Incorrectos!");
		}
		
	}
	
	public static String input(String input){
		
		String[] split = input.split(";");
		
		return calles.get(split[0]) + ";" +
			   Util.normaliza(Integer.parseInt(split[1]), 100, 5288) + ";" +
			   Util.normaliza(Integer.parseInt(split[2]), 85, 3280);
	}
	
	public static String output(String output){
		return Util.desnormaliza(new BigDecimal(output), 46500, 2700000);
	}
}
